package sky.listener;

import sky.JULLog.MyLogger;

import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
import java.util.logging.Logger;

public class ShutdownListener implements ServletContextListener {

    private static Logger logger = MyLogger.getLogger(ShutdownListener.class);

    @Override
    public void contextDestroyed(ServletContextEvent arg0) {
        logger.info("contextDestroyed");
        logger.info("DBPool shutdown start...");
        try {

        } catch (Throwable e) {
            logger.severe(e.getMessage());
        }
        logger.info("DBPool shutdown done");
    }

    @Override
    public void contextInitialized(ServletContextEvent arg0) {
        logger.info("contextInitialized");
    }

}